-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK: update error variants in Feature::from_account_info
#33750
SDK: update error variants in Feature::from_account_info
#33750
Conversation
cc6dbaa
to
35e470f
Compare
Codecov Report
@@ Coverage Diff @@
## master #33750 +/- ##
=========================================
- Coverage 81.8% 81.8% -0.1%
=========================================
Files 766 807 +41
Lines 209094 217936 +8842
=========================================
+ Hits 171138 178324 +7186
- Misses 37956 39612 +1656 |
@t-nelson , can you please sanity check us on this change? I don't see any callers of |
Another way we could address this is by duplicating/moving the |
it's not clear to me why this method returns a |
I'm not sure why it was written this way originally, especially as there's no caller, but we're about to start using it in a bpf program.
What variant do you recommend instead? It seems to be the most correct when an account isn't owned by the expected program. |
|
|
|
35e470f
to
32d5322
Compare
Swapped |
(cherry picked from commit 6b1e9b8)
Problem
Feature::from_account_info(..)
checks that theowner
field matchesFeature111111111111111111111111111111111111
but it throwsProgramError::InvalidArgument
.It also throws
ProgramError::InvalidArgument
on deserialization failure.Summary of Changes
Update these errors to be more clear.